Field of the Invention
The present invention relates to a technique for performing distance measurement with respect to a target object.
Description of the Related Art
There is known a method of projecting pattern light to a target object using a projection unit such as a projector, and specifying the position of the pattern light from a captured image obtained by capturing the target object by an image capturing unit such as a camera, thereby measuring a distance.
The reflectance of the surface of a target object and the orientation in which the target object is placed vary. Thus, the image luminance gradation value of pattern light projected from the projection unit in a captured image changes variously. To specify the position of pattern light under various conditions, brightness adjustment of pattern light and exposure amount adjustment of the image capturing unit need to be performed appropriately. If these adjustments are improper, pattern light in a captured image is saturated or causes shadow detail loss, and the position of the pattern light cannot be specified. Also, if these adjustments are insufficient, the position of pattern light may be specified, but the position specifying accuracy drops.
In Japanese Patent Laid-Open No. 2012-68176, the maximum reflectance is determined based on the image luminance gradation value of an image captured after projecting uniform pattern light in advance, and the brightness of pattern light and the exposure amount of the image capturing unit are determined based on the reflectance.
In Japanese Patent Laid-Open No. 2009-250844, the exposure amount of an image capturing unit is adjusted using the histogram of the image luminance gradation value of an image captured after projecting an optical cutting line. More specifically, in the image luminance gradation value histogram, the difference between the first peak, corresponding to an optical cutting line portion, and the second peak, corresponding to background light generated by illumination light in a measurement environment, is adjusted to be equal to or greater than a threshold. Further, the first peak is adjusted not to exceed a preset upper limit value.
In the method disclosed in Japanese Patent Laid-Open No. 2012-68176, the brightness of pattern light and the exposure amount of the image capturing unit are determined based on the image luminance gradation value of, not pattern light used to specify a position, but uniform pattern light. Thus, the influence of a decrease in the contrast of pattern light arising from, for example, a blur in the projection optical system or an image capturing optical system that is generated in pattern light used to specify a position is not taken into account. As a result, adjustment in the pattern light becomes insufficient, and the pattern position specifying accuracy may drop. Also, the maximum reflectance and exposure amount are determined based on the maximum value of the image luminance gradation value. When the target object is highly glossy, no appropriate adjustment may be performed throughout the entire frame under the influence of partially generated halation.
The invention disclosed in Japanese Patent Laid-Open No. 2009-250844 effectively functions in a case in which the peak of the image luminance gradation value histogram by projection light and the peak of background light are clearly separated. In a case in which the luminance of background light is high and is almost equal to the luminance of projection light, however, it is difficult to discriminate the peaks of the image luminance gradation value histograms of projection light and background light, and the invention may not effectively function.
There is known a recognition processing apparatus that estimates the positions and orientations of a plurality of piled target objects based on distance measurement results by a distance measurement apparatus configured to perform the above-described distance measurement. A system can be constructed, in which the robot can automatically pick piled target objects by outputting, to a robot control apparatus, the estimation results of the positions and orientations of target objects by the recognition processing apparatus.
Assuming a scene in which many target objects are piled, the distance from the apparatus to a target object changes depending on the height of the pile. If the distance from the apparatus to a target object changes, the illuminance of projection pattern light and the brightness of a captured image change. More specifically, the brightness of a captured image decreases in proportion to the square of the distance from the apparatus to a target object.
Further, light falloff at edges occurs in accordance with the position of a target object in a captured image and the position of the target object in the projection range, and the brightness of the captured image changes. That is, the captured image becomes brighter toward the center of the frame, and darker toward the edge. For example, the captured image becomes dark based on the cosine fourth-power law.
In this manner, the image luminance gradation value of pattern light projected from the projection unit in a captured image changes variously in accordance with the distance to a target object or the position in the captured image. If the captured image becomes dark, the influence of noise of an image capturing element increases, and the distance measurement accuracy decreases. The decrease in distance measurement accuracy decreases even the estimation accuracy of the position and orientation of a target object by the recognition processing apparatus. The picking system may cause a failure such as a failure in picking a target object by the robot.
To perform distance measurement at high accuracy regardless of the distance or the position in the captured image, brightness adjustment of pattern light and exposure amount adjustment of the image capturing unit need to be performed appropriately in accordance with the distance or the position in the frame. If these adjustments are improper, pattern light in a captured image is saturated or causes shadow detail loss, and distance measurement becomes impossible. If these adjustments are insufficient, distance measurement may be possible, but the measurement accuracy drops.
Japanese Patent Laid-Open No. 2000-292133 has disclosed a method of arranging an element in which the transmittance is low at the center and increases toward the edge so as to cancel the influence of light falloff at edges. Japanese Patent Laid-Open No. 2000-241131 has disclosed a range finder apparatus that controls an optical output from a light source based on the measurement result of a rough distance.
In the method disclosed in Japanese Patent Laid-Open No. 2000-292133, the illuminance of the illumination becomes constant for target objects placed at the same distance, and a decrease in accuracy by light falloff at edges can be suppressed. To the contrary, the illuminance does not become constant for target objects at different depths. For this reason, the method disclosed in Japanese Patent Laid Open No. 2000-292133 decreases the accuracy.
In the method disclosed in Japanese Patent Laid-Open No. 2000-241131, the exposure amount of the entire frame is adjusted based on a rough distance. However, optimal exposure amount adjustment is not implemented for a target object placed at a specific position in the projection area.